#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import requests


# http请求，urllib或者requests(推荐)


class HTTP:
    @staticmethod
    def get(self, url, return_json=True):
        r = requests.get(url)
        if r.status_code != 200:
            return {} if return_json else ''
        return r.json() if return_json else r.text
